package com.inspur.cloud.configuration;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "app")
@Data
public class ApiConfig {

    @Value("${env:dev}")
    private String env;//生产环境还是开发环境

    @Value("${verifyCode:false}")
    private boolean verifyCode;//是否需要验证码

    @Value("${failureTimes:4}")
    private Integer failureTimes;//运行登录失败次数

    @Value("${schedule:false}")
    private boolean schedule;//是否启用调度任务

    public boolean isDev() {
        return "dev".equals(env);
    }
}
